#ifndef MAINWINDOW_H
#define MAINWINDOW_H

//File Includes
#include "checksentry.h"
#include "editpunishments.h"

//Qt Includes
#include <QtGui>
#include <QMainWindow>

////QtSQL
#include <QSqlTableModel>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlRecord>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlRelationalTableModel>

const int sentryCountPerWeek = 112;

enum {
    Floor_ID       = 0,
    Day_Name       = 1,
    FirstF_First   = 2,
    FirstF_Second  = 3,
    SecondF_First  = 4,
    SecondF_Second = 5
};

enum {
    FirstFl_First   = 0,
    FirstFl_Second  = 1,
    SecondFl_First  = 2,
    SecondFl_Second = 3
};

enum {
    Monday = 0,
    Tuesday = 1,
    Wednesday = 2,
    Thursday = 3,
    Friday = 4,
    Saturday = 5,
    Sunday = 6
};

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    //Functions
    void getDate();
    void setDates();
    void setDateLabs(QDate);
    void selectMainTable();
    void setVisibleDateLabs(bool _visible);
    void changeSentryCount(int change, QSqlRecord record, QString sType);
    QString convertToString(QDate);

    //Arguments
    int sentryForTheWeek;

public slots:
    void checkSentry();
    void editPunishments();
    void generateMainTable();

private:
    Ui::MainWindow *ui;
    QSqlQuery query;
    QSqlTableModel *tableModel;
};

#endif // MAINWINDOW_H
